/*
 * NextAction.java
 *
 * Created on June 22, 2005, 8:33 PM
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */
package com.bff.slimserver.musicjukebox.lib.actions;

import com.bff.bjj.utils.Resources;
import java.awt.event.ActionEvent;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.Action;
import org.bff.slimserver.SlimPlaylist;
import org.bff.slimserver.exception.SlimException;

/**
 *
 * @author Bill
 */
public class NextAction extends PlaylistAction {

    /** Creates a new instance of StopAction */
    public NextAction(SlimPlaylist playlist) {
        super(playlist);

        putValue(Action.NAME, Resources.getMessage(Resources.LABEL_KEY.ACTION_NEXT_NAME));
        putValue(Action.SMALL_ICON, Resources.getIcon(Resources.ICON_KEY.ACTION_NEXT));
        putValue(Action.MNEMONIC_KEY, Resources.getKeyEvent(Resources.KEYEVENT_KEY.ACTION_NEXT));
        putValue(Action.ACCELERATOR_KEY, Resources.getKeystroke(Resources.KEYSTROKE_KEY.KEYSTROKE_NEXT));
        putValue(Action.SHORT_DESCRIPTION, Resources.getMessage(Resources.LABEL_KEY.ACTION_NEXT_SHORT_DESC));        
    }

    @Override
    public void actionPerformed(ActionEvent evt) {
        try {
            getPlaylist().playNext();
        } catch (SlimException ex) {
            Logger.getLogger(NextAction.class.getName()).log(Level.SEVERE, null, ex);
        }
       
    }
}